package project_common

type Response struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

func (r *Response) Success(data any) *Response {
	r.Code = 200
	r.Msg = "success"
	r.Data = data

	return r
}

func (r *Response) Fail(code int, data any) *Response {
	r.Code = code
	r.Msg = "failure"
	r.Data = data

	return r
}
